package com.eas.yunzhijia.easTodo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class PublicMessageEntity {

    /**
     * from : {"no":"101","pub":"XT-088723f5-72e9-4f0c-9b6f-6e44e7ce498f","time":1483067757773,"nonce":"59.7121867224962","pubtoken":"2c7a7ce75b2d439b9a7f73cf40a17fdae6d616f3"}
     * to : [{"no":"101","user":["81b88ebc-39a0-11e6-8825-005056ac6b20"]}]
     * type : 5
     * msg : {"url":"http://www.baidu.com","appid":"10245","todo":0,"text":"茉莉花","opentype":"110"}
     */

    private FromBean from;
    private int type;
    private MsgBean msg;
    private List<ToBean> to;

    @NoArgsConstructor
    @Data
    public static class FromBean {
        /**
         * no : 101
         * pub : XT-088723f5-72e9-4f0c-9b6f-6e44e7ce498f
         * time : 1483067757773
         * nonce : 59.7121867224962
         * pubtoken : 2c7a7ce75b2d439b9a7f73cf40a17fdae6d616f3
         */

        private String no;
        private String pub;
        private long time;
        private String nonce;
        private String pubtoken;
    }

    @NoArgsConstructor
    @Data
    public static class MsgBean {
        /**
         * url : http://www.baidu.com
         * appid : 10245
         * todo : 0
         * text : 茉莉花
         * opentype : 110
         */

        private String url;
        private String appid;
        private int todo;
        private String text;
        private String opentype;
    }

    @NoArgsConstructor
    @Data
    public static class ToBean {
        /**
         * no : 101
         * user : ["81b88ebc-39a0-11e6-8825-005056ac6b20"]
         */

        private String no;
        private List<String> user;
    }
}
